{%  extends "base.html" %}

{% block site_name %}用户界面{% endblock %}
{% block header %}用户模式{% endblock %}
{% block left_body %}
        <ul class="nav flex-column nav-pills">
            <li class="nav-item">
                <a  class="nav-link active" href="/">转到主界面</a>
            </li>
          <li class="nav-item">
            <a class="nav-link" href="/admin/">转到管理员界面</a>
          </li>
          <li class="nav-item">
            <a class="nav-link"  href="change-password/">修改密码</a>
          </li>
          <li class="nav-item">
            <a class="nav-link"  href="signup/">校外用户注册</a>
          </li>
          <li class="nav-item">
            <a class="nav-link"  href="search/">图书信息查询</a>
          </li>
          <li class="nav-item">
            <a class="nav-link"  href="borrow/">图书借阅</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="return/">图书还书</a>
          </li>
        </ul>
{% endblock %}

{% block right_body %}
<h4>
    这里是用户的界面，可以查询图书信息，也可以登录后在自己的账号下进行借阅、还书
</h4>
<br>
{% if login==False %}
<h3 class="text-center text-primary">请登录</h3>
<form role="form" action="/user/login/" method="post">
    <div class="form-group">

        <label for="id">
            用户学生/教工号
        </label>
        <input type="text" class="form-control" name="id"/>
    </div>
    <div class="form-group">

        <label for="password">
            密码
        </label>
        <input type="password" class="form-control" name="password" />
    </div>
    <button type="submit" class="btn btn-primary">
        登录
    </button>
</form>
{% endif %}




{% if login %}
<h3 class="text-success text-center">{{ Utype }}{{ Uname }}已经成功登录</h3>
{% if Urestrict %}
    <h3 class="text-danger text-center">您的账户已经被禁用！</h3>
{% endif %}
<form role="form" action="/user/logout/" method="post">
    <div class="form-group">
    <button type="submit" class="btn btn-primary">
        退出登录请点击这里
    </button>
    </div>
</form>
{% endif %}



{% if error %}
<h3 class="text-danger text-center">您登录失败，是不是账号密码有误？</h3>
{% endif %}

{% endblock %}
